interface IUSer {
    userName: string;
    password: string;
    phone: number;
    login: () => void;
}

function testFn(target: any, discriptor: any){
    console.log(target);
    target()
    console.log(discriptor);
}

class User2 implements IUSer {
    userName;
    password;
    phone;
    constructor(userName: string, password: string, phone: number) {
      console.log("执行");
      this.userName = userName;
      this.password = password;
      this.phone = phone;
    }
    @testFn
    login() {
      console.log("我成功登录了",this.userName);
    }
  }
  
  var user = new User2('小郑','123456',10086)
//   user.login()